function fftFilterStruct = applyFilter(fftImage, H)

isColor = size(size(fftImage),2) > 2;

if (isColor)
    fftFilterStruct.fftImage(:,:,1) = fftImage(:,:,1).*H;
    fftFilterStruct.fftImage(:,:,2) = fftImage(:,:,2).*H;
    fftFilterStruct.fftImage(:,:,3) = fftImage(:,:,3).*H;
else
    fftFilterStruct.fftImage = fftImage.*H;
end
fftFilterStruct.real = real(fftFilterStruct.fftImage);
fftFilterStruct.imag = imag(fftFilterStruct.fftImage);
fftFilterStruct.module = sqrt(fftFilterStruct.real.^2 + fftFilterStruct.imag.^2);
fftFilterStruct.phase = atan2(fftFilterStruct.imag, fftFilterStruct.real);
fftFilterStruct.exists = 1;
fftFilterStruct.ifftImage = doIFFT(fftFilterStruct);
end